Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jimmy Dan Mortensen 77 posts 197 karma points
    Dec 16, 2011 @ 14:05
    Jimmy Dan Mortensen
    0

    If true { run Razor-Macro1} Else {run Razor-Macro2}

    Basically I'm trying to create it so that if I have selected a media-item (Property-field on my document-type) it shall show the img and If I haven't selected any media it shall run a Razor Macro instead.

    Any ideas?

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    Dec 16, 2011 @ 14:09
    Sebastiaan Janssen
    0

    You can do this with RenderPage:

    @if(myBoolean) { 
    <img src="blank.gif" />
    } else {
    @RenderPage("~/macroScripts/MyOtherRazorMacro.cshtml")
Please Sign in or register to post replies

Write your reply to:

Draft